<?php
	//echo form_open('c_challenge/edit') . PHP_EOL;
	if (!$isFinished)
	{
		echo form_open($action) . PHP_EOL;
	
		echo validation_errors();
		
		echo $edit_error;
		
		echo "<p>EDIT CHALLENGE" . "</p>" . PHP_EOL;
		
		echo "<p>Name:<br />" . form_input('vName', $name). "</p>" . PHP_EOL;
			
		echo "<p>Abstract:<br />" . form_textarea('vAbstract', $abstract) . "</p>" . PHP_EOL;
		
		echo "<p>Description:<br />" . form_textarea('vDescription', $description) . "</p>" . PHP_EOL;
		
		echo "<p>Status: " . PHP_EOL;
	
		if($isInactive)
		{
			echo form_radio('vStatus', 'inactive', $status['inactive']) . " Inactive" . PHP_EOL;
			echo form_radio('vStatus', 'active', $status['active']) . " Active" . PHP_EOL;
			echo form_radio('vStatus', 'finished', $status['finished']) . " Finished</p>" . PHP_EOL;
		}
		elseif($isActive)
		{
			echo form_radio('vStatus', 'active', $status['active']) . " Active" . PHP_EOL;
			echo form_radio('vStatus', 'finished', $status['finished']) . " Finished</p>" . PHP_EOL;
		}		
		
		echo form_submit('edit_challenge', 'Submit') . PHP_EOL;	
	}
	else
	{		
		echo $edit_error;
		
		echo "<p>Name:<br />" . $name . "</p>" . PHP_EOL;

		echo "<p>Abstract:<br />" . $abstract . "</p>" . PHP_EOL;
			
		echo "<p>Description:<br />" . $description . "</p>" . PHP_EOL;
		
		echo "<p>Status:<br /> Finished</p>" . PHP_EOL;
	}
	

?>

</form>